﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Clotho.Novelview {
	internal class FontTable {


		public (Font title, Font body)[] table;
		public FontTable(Font base_font) {
			table = new (Font title, Font body)[8];
			for (int i = 0; i < table.Length; i++) {
				table[i] = (new Font(base_font.FontFamily, (float)(base_font.Size * (0.2 * i + 1) * 1.20)),
					new Font(base_font.FontFamily, (float)(base_font.Size * (0.2 * i + 1) ))
					);
			}
		}
		int size = 0;
		public event EventHandler FontChanged;
		public void inc() {
			if (size + 1 < table.Length) {
				size++;
				FontChanged?.Invoke(this, EventArgs.Empty);
			}
		}
		public void dec() {
			if (size > 0) {
				size--;
				FontChanged?.Invoke(this, EventArgs.Empty);
			}

		}
		public Font Body => table[size].body;
		public Font Title => table[size].title;
	}
}
